﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace MrPP.SerriedCabinet
{
    public class CellBoard : MonoBehaviour
    {
        [SerializeField]
        private Text _name;
        [SerializeField]
        private Text _position;
        public void hide()
        {
            this.gameObject.SetActive(false);
        }
        public void show(CabinetGroup.ItemData data)
        {
           // Debug.LogError(data.text);
            _name.text = data.text;
            _position.text = (data.position.y+1).ToString() + "层," + (data.position.x+1).ToString() + "节";
            if (data.type == Box.Type.Left)
            {
                this.transform.localEulerAngles = new Vector3(0, 0, 0);
            }
            else {
                this.transform.localEulerAngles = new Vector3(0, 180, 0);
            }
            this.gameObject.SetActive(true);
        }
    }
}